﻿using System;
using System.Collections;
using System.Reflection;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using AnyOffice.Components;
using AnyOffice.DAL;
using log4net;
namespace AnyOffice.general.mytable
{
    public partial class email : System.Web.UI.UserControl 
    {
        private static ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
         protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                SqlConnection conn = new SqlConnection(ConfigManager.ConnectionString);
                DataTable table = new EmailDao().SelectMyTable(conn, HttpContext.Current.User.Identity.Name);
                if (table.Rows.Count > 0)
                {
                    this.rptEmail.DataSource = table;
                    this.rptEmail.DataBind();
                }
                else
                {
                    this.litEmail.Text = "·暂无内部邮件";
                }
                conn.Close();
            }
            catch (Exception exception)
            {
                if (log.IsErrorEnabled)
                {
                    log.Error("", exception);
                }
            }
        }
 
    }
}